package com.iqiyi.pps.epg.api.server.iservice;

import com.iqiyi.mams.hedvig.http.mediatype.ExtendedMediaType;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * Created by karkarrotxu on 2017/4/14.
 */
@Path("/stream")
@Produces({ExtendedMediaType.APPLICATION_X_THRIFT})
public interface StreamApiService {
    @POST
    @Path("/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String createStream(@FormParam("fatherId") String fatherId,
                               @FormParam("streamName") String streamName,
                               @FormParam("streamIp") String streamIp,
                               @FormParam("streamType") String streamType,
                               @FormParam("peerCount") String peerCount,
                               @FormParam("bcsNum") String bcsNum,
                               @FormParam("cutterIdFlv") String cutterIdFlv,
                               @FormParam("cutterIdTs") String cutterIdTs,
                               @FormParam("dest") String dest,
                               @FormParam("streamApiVersion") int streamApiVersion,
                               @FormParam("dolbyStreamName") String dolbyStreamName,
                               @FormParam("dolbyStreamUrl") String dolbyStreamUrl,
                               @FormParam("dolbyAudioChannel") String dolbyAudioChannel,
                               @FormParam("encodeType") int encodeType,
                               @FormParam("streamAddress") String streamAddress,
                               @FormParam("playType") int playType,
                               @FormParam("backupEachOther") int backupEachOther
    );

    @POST
    @Path("/deleteById")
    @Produces(MediaType.APPLICATION_JSON)
    public String deleteStreamById(@FormParam("id") Long id);

    @POST
    @Path("/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String getStreamList(@FormParam("fatherId") String fatherId);

    @POST
    @Path("/get")
    @Produces(MediaType.APPLICATION_JSON)
    public String getStreamById(@FormParam("id") Long id);

    @POST
    @Path("/edit")
    @Produces(MediaType.APPLICATION_JSON)
    public String editStream(@FormParam("id") String id,
                             @FormParam("fatherId") String fatherId,
                             @FormParam("streamIp") String streamIp,
                             @FormParam("streamType") String streamType,
                             @FormParam("peerCount") String peerCount,
                             @FormParam("bcsNum") String bcsNum,
                             @FormParam("cutterIdFlv") String cutterIdFlv,
                             @FormParam("cutterIdTs") String cutterIdTs,
                             @FormParam("isEnable") String isEnable,
                             @FormParam("dest") String dest,
                             @FormParam("streamApiVersion") int streamApiVersion,
                             @FormParam("playType") int playType,
                             @FormParam("backupEachOther") int backupEachOther

    );

    @POST
    @Path("/encodeServerStat")
    @Produces(MediaType.APPLICATION_JSON)
    public String encodeServerStat(@FormParam("serverIp") String serverIp,
                                   @FormParam("signalDesc") String signalDesc,
                                   @FormParam("inputSignal") String inputSignal,
                                   @FormParam("outputSignal") String outputSignal,
                                   @FormParam("extraData") String extraData,
                                   @FormParam("encodeType") int encodeType,
                                   @FormParam("status") int status);

    @GET
    @Path("/cutterIdInfo")
    @Produces(MediaType.APPLICATION_JSON)
    public String getCutterIdInfo(@QueryParam("maxVal") int maxVal,
                                  @QueryParam("cutterType") String cutterType,
                                  @QueryParam("sortType") String sortType);


    @POST
    @Path("/search")
    @Produces(MediaType.APPLICATION_JSON)
    public String getStreamSearchList(@FormParam("fatherId") String fatherId,
                                      @FormParam("streamName") String streamName,
                                      @FormParam("pageNo") Integer pageNo,
                                      @FormParam("pageSize") Integer pageSize
    );

    @POST
    @Path("/switchBackup")
    @Produces(MediaType.APPLICATION_JSON)
    public String switchBackup(@FormParam("fatherId") String fatherId,
                               @FormParam("qipuId") String qipuId);
}
